package com.legal.aid.app.controller;

import com.legal.aid.app.domain.dto.ChatDto;
import com.legal.aid.app.service.AiChatService;
import com.legal.aid.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/ai")
public class AIChatController {

    @Autowired
    private AiChatService aiChatService;

//    @PostMapping
//    public AjaxResult talk(@RequestBody ChatDto chatDto) {
//        String response=aiChatService.talk(chatDto);
//        return AjaxResult.success(response);
//    }

    @RequestMapping
    public AjaxResult talk( String content) {
        String response=aiChatService.talk(content);
        return AjaxResult.success(response);
    }


}
